package ltd.smallwang.infrastructure.util;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

class PasswordUtilTest {

  @Test
  void testMatch() {
    Assertions.assertThat(PasswordUtil.matches("123456",
            "$argon2id$v=19$m=16384,t=2,p=1$oClyV7+O/OnG+OkVTB2oAg$0cu6/eLcOb3VXS0OoN9cXhLP6bV3OHqjLiJueROPF2Y"))
        .isTrue();
    Assertions.assertThat(PasswordUtil.matches("654321",
            "$argon2id$v=19$m=16384,t=2,p=1$oClyV7+O/OnG+OkVTB2oAg$0cu6/eLcOb3VXS0OoN9cXhLP6bV3OHqjLiJueROPF2Y"))
        .isFalse();
  }
}
